import request from '@/utils/request'

export function list() {
  return request({
    url: 'admin/menu/list',
    method: 'get'
  })
}

export function tree() {
  return request({
    url: 'admin/menu/tree',
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: 'admin/menu/add',
    method: 'post',
    data
  })
}

export function del(data) {
  return request({
    url: 'admin/menu/delete',
    method: 'post',
    data
  })
}

export function edit(data) {
  return request({
    url: 'admin/menu/update',
    method: 'post',
    data
  })
}

export default { add, edit, del, list, tree }
